import { ServiceGoodsGetResultModel } from './model/orderModel'
import { defHttp } from '/@/utils/http/axios'
const prefix = '/service.order/'
// api接口列表
enum Api {
  list = 'list',
  detail = 'detail',
  confirmReceipt = 'confirmReceipt',
  confirmCancel = 'confirmCancel',
  updatePrice = 'updatePrice',
  confirmCompletion = 'confirmCompletion',
}

/**
 * 获取列表数据
 * @param {*} params
 */
export const list = (params) => defHttp.get<ServiceGoodsGetResultModel>({ url: prefix + Api.list, params })
/**
 * 获取单条记录信息
 * @param {*} params
 */
export const detail = (params) => defHttp.get<ServiceGoodsGetResultModel>({ url: prefix + Api.detail, params })
/**
 * 服务商订单确认完成
 * @param {*} data
 */
export const confirmReceipt = (data) => defHttp.post<any>({ url: prefix + Api.confirmReceipt, data })
/**
 * 服务商订单确认取消
 * @param {*} data
 */
export const confirmCancel = (data) => defHttp.post<any>({ url: prefix + Api.confirmCancel, data })
/**
 * 服务商订单修改订单价格
 * @param {*} data
 */
export const updatePrice = (data) => defHttp.post<any>({ url: prefix + Api.updatePrice, data })
/**
 * 服务商订单确认完成
 * @param {*} data
 */
export const confirmCompletion = (data) => defHttp.post<any>({ url: prefix + Api.confirmCompletion, data })
